import request from '@/router/axios';

export const getBatch = (current, size, params) => {
    return request({
      url: '/api/blade-system/Batch/list',
      method: 'get',
      params: {
        ...params,
        current,
        size,
      }
    })
  }
  
  export const getVagelist = (current, size, params) => {
    return request({
      url: '/api/blade-system/classfl/list',
      method: 'get',
      params: {
        ...params,
        current,
        size,
      }
    })
  }

  export const insertBatch = (formdata) => {
    return request({
      url: '/api/blade-system/Batch/insertBatch',
      method: 'post',
      data:formdata
    })
  }

  export const getEexcel = () => {
    return request({
      url: '/api/blade-system/upload/downloadExcel',
      method: 'post',
      responseType:'blob'
    })
  }

  export const uploadBatch = (formdata) => {
    return request({
      url: '/api/blade-system/upload/uploadBatchexcel',
      method: 'post',
      data:formdata
    })
  }

  export const getBatchdetail = (formdata) =>{
    return request({
      url: '/api/blade-system/batchdetail/getList',
      method: 'post',
      data:formdata
    })
  }

  export const delvegetables = (params) =>{
    return request({
      url: '/api/blade-system/Batch/delvegetables',
      method: 'post',
      data:params
    })
  }
  
  export const getUser = (role) =>{
    return request({
      url: '/api/blade-user/getUserList',
      method: 'get',
      params:{
        role
      }
    })
  }

  export const addVagetables = (formdata) =>{
    return request({
      url: '/api/blade-system/Batch/addVagetables',
      method: 'post',
      data:formdata
    })
  }

  export const updateBatch = (formdata) =>{
    return request({
      url: '/api/blade-system/Batch/updateBatch',
      method: 'post',
      data:formdata
    })
  }

  
  export const DelBatch = (formdata) =>{
    return request({
      url: '/api/blade-system/Batch/DelBatch',
      method: 'post',
      data:formdata
    })
  }

  export const takeSell = (formdata) =>{
    return request({
      url: '/api/blade-system/Batch/takeSell',
      method: 'post',
      data:formdata
    })
  }

  
